package com.eliza.base.views.learn.collect

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import com.eliza.base.viewrouter.NavLearnEnum

@Preview
@Composable
fun LearnCollectScreenPre() {
    LearnCollectScreen(rememberNavController())
}

@Composable
fun LearnCollectScreen(navController: NavController) {
    Column {
        Text(text = "LearnCollectScreen")
        TextButton(onClick = { navController.navigate(NavLearnEnum.Text.title) }) {
            Text(text = NavLearnEnum.Text.title)
        }
        ScrollBoxes()
    }
}

@Composable
fun ScrollBoxes() {
    Column(
        modifier = Modifier
            .background(Color.LightGray)
            .size(100.dp)
            .verticalScroll(rememberScrollState())
    ) {
        repeat(10) {
            Text("Item $it", modifier = Modifier.padding(2.dp))
        }
    }
}